import request from '@/util/network_request/request.ts'
/***    
request.globalRequest(url,请求方式,obj数据,123,true单,true 多array)url, method, data, power, isUpload, isFiles
1===没登录前的请求头
2===携带请求头token
3===刷新token
***/
const apiReturnFac = {}
//  新建返厂单
apiReturnFac.saveReturnFac = (data) => request.globalRequest({
	url: `/mobile/network/repair/save`,
	method: 'post',
	data,
	power: 2
})
// 获取返厂模块下拉数据
apiReturnFac.getMobileRepairModule = () => request.globalRequest({
	url: `/mobile/select/getMobileRepairModule`,
	method: 'GET',
	power: 2
})
// 根据返厂模块ID获取返厂模块关联的自定义字段
apiReturnFac.getRepairModuleField = (repairModuleId) => request.globalRequest({
	url: `/mobile/select/getRepairModuleField/${repairModuleId}`,
	method: 'get',
	power: 2
})
// 获取客户下拉数据
apiReturnFac.getUserDataSelect = (data) => request.globalRequest({
	url: `/mobile/select/getUserDataSelect`,
	method: 'post',
	data,
	power: 2
})
// 获取返厂详情
apiReturnFac.getUserRepairDetail = (id) => request.globalRequest({
	url: `/mobile/network/repair/getNetworkRepairDetail/${id}`,
	method: 'get',
	power: 2
})
// 获取返厂列表
apiReturnFac.getUserRepairList = (data) => request.globalRequest({
	url: `/mobile/network/repair/getNetworkRepairList`,
	data,
	method: 'post',
	power: 2
})
// 获取返厂详情的商品信息
apiReturnFac.getUserRepairGoodsDetail = (id) => request.globalRequest({
	url: `/mobile/network/repair/getRepairGoodsDetail/${id}`,
	method: 'get',
	power: 2
})
// 获取返厂列表的状态数量
apiReturnFac.getUserRepairListSatusCount = () => request.globalRequest({
	url: `/mobile/network/repair/getRepairListSatusCount`,
	method: 'get',
	power: 2
})
// 获取服务进度
apiReturnFac.getRepairLog = (data, id) => request.globalRequest({
	url: `/mobile/network/repair/getRepairLog/${id}`,
	data,
	method: 'post',
	power: 2
})
// 获取返厂自定义字段
apiReturnFac.getUserRepairField = (id) => request.globalRequest({
	url: `/mobile/network/repair/getRepairField/${id}`,
	method: 'get',
	power: 2
})
// ----------- 返厂相关 -----------
// 根据返厂模块ID获取默认返厂地址
apiReturnFac.getRepairModuleCallbackFactoryAddr = (id) => request.globalRequest({
	url: `/mobile/select/getRepairModuleCallbackFactoryAddr/${id}`,
	method: 'get',
	power: 2
})
// 获取物流下拉列表
apiReturnFac.getLogisticsSelectList = (data) => request.globalRequest({
	url: `/mobile/select/getLogisticsSelectList`,
	method: 'post',
	data,
	power: 2
})
// 保存填写返厂物流
apiReturnFac.saveCallbackFactoryLogistics = (id, data) => request.globalRequest({
	url: `/mobile/network/repair/saveCallbackFactoryLogistics/${id}`,
	method: 'post',
	data,
	power: 2
})

/**
 * 确认签收
 * @params {String} repairId - 返厂id
 */
apiReturnFac.confirmSignFor = (repairId) => request.globalRequest({
	url: `/mobile/network/repair/saveSureSign/${repairId}`,
	method: 'post',
	power: 2
})

export default apiReturnFac